package com.fashop.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.fashop.bean.beacon.BeaconIn;
import com.fashop.bean.beacon.BeaconOut;
import com.fashop.bean.beacon.BuscarMensajeBeacon;
import com.fashop.bean.beacon.ListadoBeacon;
import com.fashop.dao.BeaconDao;
import com.fashop.service.BeaconService;

@Service("beaconServiceImpl")
public class BeaconServiceImpl implements  BeaconService{
	
	@Resource(name = "beaconDaoImpl")
	private BeaconDao beaconDao;
	
	
	
	public BeaconOut crear(BeaconIn beacon) {
		
		return null;
	}

	public BeaconOut actualizar(BeaconIn beacon) {
		// TODO Auto-generated method stub
		return null;
	}

	public BeaconOut eliminar(BeaconIn beacon) {
		// TODO Auto-generated method stub
		return null;
	}

	public ListadoBeacon listBeaconMsje(BuscarMensajeBeacon buscarMsje) {
		
		return null;
	}

	public Long getIdBeacon(String uuid, String proximidad) {
		Long lIdBeacon=null;
		Long idBeacon=beaconDao.getIdBeacon(uuid,proximidad);
		if (idBeacon!=null)
			lIdBeacon=Long.valueOf(idBeacon); 
		return lIdBeacon;
	}

	public Integer actualizarContador(Long idbeacon) {
		BeaconIn beaconIn = new BeaconIn();
		beaconIn.setIdbeacon(idbeacon);
		Integer resultado=beaconDao.actualizarVistas(beaconIn);
		return resultado;
	}

}
